<?php

App::uses('AppModel', 'Model');

/**
 * PAI Model
 *
 * @property Cidade $CIDADE
 */
class Pais extends AppModel {

    /**
     * Use table
     *
     * @var mixed False or table name
     */
    public $useTable = 'PAIS';
    public $displayField = array('Código', 'Pais', 'Nacionalidade', 'Codigo SUS');

    /**
     * Primary key field
     *
     * @var string
     */
    public $id = 'CD_PAIS';
    public $primaryKey = 'CD_PAIS';

    /**
     * Validation rules
     *
     * @var array
     */
    public $validate = array(
        'CD_PAIS' => array(
            'notempty' => array(
                'rule' => array('notempty'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
        'NM_PAIS' => array(
            'alphanumeric' => array(
                'rule' => array('alphanumeric'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
        'NACIO_PAIS' => array(
            'alphanumeric' => array(
                'rule' => array('alphanumeric'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
        'CO_NACIONALIDADE_SUS' => array(
            'alphanumeric' => array(
                'rule' => array('alphanumeric'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed

    /**
     * hasMany associations
     *
     * @var array
     */
    public $hasMany = array(
        'CIDADE' => array(
            'className' => 'Cidade',
            'foreignKey' => 'CD_PAIS',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        )
    );

}
